import request from '@/api/request'

//添加分类
 function addCategory(data) {
  return request({
    url: '/lejuAdmin/category/addCategory',
    method: 'POST',
    data
  })
}
//删除分类
function delCategory(id,data) {
    return request({
      url:`/lejuAdmin/category/delCategory/${id}`,
      method: 'DELETE',
      data
    })
  }
//查询所有一二级分类
function getAllCategory(data) {
    return request({
      url: '/lejuAdmin/category/getAllCategory',
      method: 'GET',
      data
    })
  }
//更新分类
function updateCategory(data) {
    return request({
      url: '/lejuAdmin/category/updateCategory',
      method: 'POST',
      data
    })
  }
export default{
    addCategory,delCategory,getAllCategory,updateCategory
}
